package com.squirrel.serialportcore.entity.model;

/**
 * Exchange属性配置类
 *
 * @author Squbi
 * @date 2021/3/16 16:36
 */
public class ExchangeModel {
    /**
     * 以下属性解释
     * <p>
     * exchangeName 交换机名
     * exchangeType 交换机交换类型
     * durable 持久化
     * autoDelete 自动删除
     * internal
     *
     * @author Squbi
     * @date 2021/3/16 16:40
     */
    private String exchangeName;
    private ExchangeType exchangeType;
    private boolean durable = false;
    private boolean autoDelete = false;

    /**
     * 以下构造方法
     * ------------------
     */
    public ExchangeModel(String exchangeName, ExchangeType exchangeType) {
        this.exchangeName = exchangeName;
        this.exchangeType = exchangeType;
    }

    public ExchangeModel(String exchangeName, ExchangeType exchangeType, boolean durable) {
        this.exchangeName = exchangeName;
        this.exchangeType = exchangeType;
        this.durable = durable;
    }

    public ExchangeModel(String exchangeName, ExchangeType exchangeType, boolean durable, boolean autoDelete) {
        this.exchangeName = exchangeName;
        this.exchangeType = exchangeType;
        this.durable = durable;
        this.autoDelete = autoDelete;
    }

    /**
     * 以下失血模型
     * ------------------
     */
    public String getExchangeName() {
        return exchangeName;
    }

    public ExchangeModel setExchangeName(String exchangeName) {
        this.exchangeName = exchangeName;
        return this;
    }

    public ExchangeType getExchangeType() {
        return exchangeType;
    }

    public ExchangeModel setExchangeType(ExchangeType exchangeType) {
        this.exchangeType = exchangeType;
        return this;
    }

    public boolean isDurable() {
        return durable;
    }

    public ExchangeModel setDurable(boolean durable) {
        this.durable = durable;
        return this;
    }

    public boolean isAutoDelete() {
        return autoDelete;
    }

    public ExchangeModel setAutoDelete(boolean autoDelete) {
        this.autoDelete = autoDelete;
        return this;
    }
}
